<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }
        #move {
            width: 100px;
            height: 100px;
            background-color: red;
            position: absolute;
        }
        #line {
            width: 1px;
            height: 800px;
            left: 400px;
            background-color: black;
            position: absolute;
        }
        #line2 {
            width: 800px;
            height: 1px;
            left: 0;
            top: 400px;
            background-color: black;
            position: absolute;
        }
        #move2 {
            width: 100px;
            height: 100px;
            background-color: blue;
            position: absolute;
            left: 0;
            top: 200px;
        }
    </style>
    <script type="text/javascript" src="js/tools.js"></script>
    <script type="text/javascript">
        window.onload = () => {
            let move = document.getElementById("move");
            let rightMove = document.getElementById("rightMove");
            let leftMove = document.getElementById("leftMove");

            rightMove.onclick = () => {
                moveTo(move, "left", 400, 10);
            }
            leftMove.onclick = () => {
                moveTo(move, "left", 0, 10);
            }
            let move2 = document.getElementById("move2");
            let rightMove2 = document.getElementById("rightMove2");
            let leftMove2 = document.getElementById("leftMove2");
            rightMove2.onclick = () => {
                moveTo(move2, "width", 400, 10);
            }
            leftMove2.onclick = () => {
                moveTo(move2, "width", 0, 10);
            }


        }
    </script>
</head>
<body>

    <ul>
        <li>
            <button id="rightMove" style="width: 40px;">right</button>
            <button id="leftMove" style="width: 40px;">left</button>
        </li>
        <li>
            <button id="rightMove2" style="width: 40px;">right2</button>
            <button id="leftMove2" style="width: 40px;">left2</button>
        </li>
    </ul>
    <div id="move"></div>
    <div id="line"></div>
    <div id="line2"></div>
    <div id="move2"></div>
    
</body>
</html>